package cn.com.css.taxInspection.gt3.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.css.taxInspection.gt3.mapper.JcAjztTjBjMapper;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjBjEntity;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjJcEntity;
import cn.com.css.taxInspection.gt3.entity.JcAjztTjZjjcEntity;
import cn.com.css.taxInspection.gt3.service.JcAjztTjBjService;
import cn.com.css.taxInspection.util.TsBqUtils;


@Service("jcAjztTjBjService")
public class JcAjztTjBjServiceImpl extends ServiceImpl<JcAjztTjBjMapper, JcAjztTjBjEntity> implements JcAjztTjBjService {

	@Override
	@DS("oracle")
	public IPage<JcAjztTjBjEntity> infoPage(JcAjztTjBjEntity jcAjztTjBjEntity) {
		Page page = new Page(jcAjztTjBjEntity.getPage(), jcAjztTjBjEntity.getLimit());
		LambdaQueryWrapper<JcAjztTjBjEntity> queryWrapper = Wrappers.lambdaQuery();
		
		if(TsBqUtils.isNotNull(jcAjztTjBjEntity.getJcry())){
			queryWrapper.eq(JcAjztTjBjEntity::getJcry, jcAjztTjBjEntity.getJcry());
		}
		if(TsBqUtils.isNotNull(jcAjztTjBjEntity.getNd())){
			queryWrapper.eq(JcAjztTjBjEntity::getNd, jcAjztTjBjEntity.getNd());
		}
		if(TsBqUtils.isNotNull(jcAjztTjBjEntity.getSwjgDm())){
			queryWrapper.eq(JcAjztTjBjEntity::getSwjgDm, jcAjztTjBjEntity.getSwjgDm());
		}
		
		IPage<JcAjztTjBjEntity> iPage = this.page(page, queryWrapper);
		
		return iPage;
	}


}